<template>
	<view class="kupono-confirm-detail">
		<titleName :name="name"></titleName>
		<view class="title-bgc"></view>
		<view class="content-wrap">
			<uni-collapse-item title="转移联单详情" :show-animation="true" :open="false">
				<view class="transfer-detail">
					<view class="unit">产废单位：河南全会有限公司</view>
					<view class="unit">排污许可证号：78195698456378567</view>
					<view class="unit">危废类型：测试名称</view>
					<view class="unit">处置量：4kg</view>
					<view class="unit">处置联单编号：123456789012346</view>
					<view class="unit">创建时间：2024-05-01</view>
					<view class="unit">处置联单图片：<button>点击查看</button></view>
					<view class="unit">产废联系人：薛伟</view>
					<view class="unit">联系电话：12345678901</view>
					<view class="unit">车辆信息：豫a1234</view>
					<view class="unit">驾驶员：李师傅</view>
				</view>
			</uni-collapse-item>
			<view class="dispose-wrap">
				<uni-collapse-item title="处置单位" :show-animation="true" :open="false">
					<view class="transfer-detail">
						<view class="unit">处置单位：河南处置有限公司</view>
						<view class="unit">营业执照代码：12345678903457</view>
						<view class="unit">联系人：李新生</view>
						<view class="unit">联系电话：12345678901</view>
						<view class="btn-wrap">
							<button class="save">确认创建联单</button>
							<button class="back">退回联单</button>
						</view>
					</view>
				</uni-collapse-item>
			</view>
		</view>


	</view>
</template>

<script setup>
	import titleName from '../../components/titleName.vue'
	import noData from '../../components/noDataShow.vue'
	import http from '../../request/index'
	import uploadFile from '../../request/uploadFile.js'
	import {
		onShow,
		onLoad
	} from '@dcloudio/uni-app'
	import {
		reactive,
		ref
	} from 'vue'
	let adviceTypeList = ref([])
	let unitList = ref([])
	let value = 0
	let dataList = ref([{}, {}, {}, {}, {}, {}, {}])
	let statusList = ref([])
	let total = ref('')
	let queryParams = reactive({})
	let id = ref('')
	let dataTree = ref()
	let showLine = ref('none')
	let change = (e) => {

		console.log(e, 'e')

	}
	let name = "创建联单"
	onLoad((e) => {



	})
	onShow(() => {
		getList()
	})

	function mapTree(data) {
		console.log(data, 'data');
		if (data.length <= 0) return

		return data.map((item) => {
			item.text = item.regionname
			item.value = item.id
			if (item.lstSubNodes && item.lstSubNodes.length > 0) {
				item.children = item.lstSubNodes
				for (var i = 0; i < item.lstSubNodes.length; i++) {

					item.children[i].text = item.lstSubNodes[i].regionname
					item.children[i].value = item.lstSubNodes[i].id
					if (item.lstSubNodes[i].lstSubNodes && item.lstSubNodes[i].lstSubNodes.length > 0) {
						mapTree(item.lstSubNodes[i].lstSubNodes)
					}
				}
			}
			return item
		})
	}

	// let getList = () => {
	// 	http({
	// 		url: "/wasteDispose/datalist",
	// 		data: {
	// 			stockenterpriseid: id.value,
	// 			...queryParams
	// 		}
	// 	}).then((res) => {
	// 		if (res.code == 0) {
	// 			dataList.value = res.data.list
	// 			total.value = res.data.total

	// 		}
	// 	})
	// }
	let dataChange = (e) => {
		console.log(e, 'e');
		if (e.length == 0) {
			showLine.value = 'none'
			queryParams.startdate = ''
			queryParams.enddate = ''
			return
		}
		queryParams.startdate = e[0]
		queryParams.enddate = e[1]
		showLine.value = 'block'
	}
	http({
		url: '/listitem/getmodule',
		data: {
			module: 'B03'
		}
	}).then((res) => {
		if (res.code == 0) {
			let data = res.data
			adviceTypeList.value = data.map((item) => {
				return {
					text: item.name,
					value: item.id
				}
			})

		}
	})
</script>

<style lang="scss" scoped>
	:deep(.uni-collapse-item__title-text) {

		font-family: Source Han Sans CN;
		font-weight: bold;
		font-size: 35rpx;
		color: #333333;
		position: relative;
		padding-left: 28rpx;
	}

	:deep(.uni-collapse-item) {
		background-color: #fff;
	}

	:deep(.uni-collapse-item__title-text)::before {
		content: '';
		width: 8rpx;
		height: 32rpx;
		background: #0874FA;
		border-radius: 4rpx;
		position: absolute;

		left: 0;
		top: 50%;
		transform: translateY(-50%);
	}

	.kupono-confirm-detail {
		width: 100vw;
		height: 100vh;

		.title-bgc {
			width: 750rpx;
			height: 160rpx;
			background: #0874FA;
		}



		.content-wrap {
			height: calc(100vh - 160rpx);
			width: 100vw;
			background-color: #F3F5F7;
			padding-top: 13rpx;
			overflow: scroll;
			.dispose-wrap {
				margin-top: 16rpx;
				padding-bottom: 60rpx;

				.transfer-detail {
					.unit {

						font-family: Source Han Sans CN;
						font-weight: 400;
						font-size: 28rpx;
						color: #333333;

					}

					.btn-wrap {
						display: flex;
						align-items: center;
						margin-top: 90rpx;

						.save {
							width: 299rpx;
							height: 88rpx;
							background: #0874FA;
							border-radius: 44rpx;
							line-height: 88rpx;
							font-family: Source Han Sans CN;
							font-weight: 500;
							font-size: 31rpx;
							color: #FFFFFF;

						}

						.back {
							width: 299rpx;
							height: 88rpx;
							background: #FF6666;
							border-radius: 44rpx;
							line-height: 88rpx;
							font-family: Source Han Sans CN;
							font-weight: 500;
							font-size: 31rpx;
							color: #FFFFFF;
							margin-left: 38rpx;
						}
					}
				}
			}

			.transfer-detail {
				padding-left: 54rpx;
				padding-bottom: 60rpx;

				.unit:first-child {
					margin-top: 20rpx !important;
				}

				.unit {
					display: flex;
					align-items: center;
					font-family: Source Han Sans CN;
					font-weight: 400;
					font-size: 28rpx;
					color: #333333;
					margin-top: 33rpx;

					button {
						color: #0874FA;
						font-weight: 400;
						font-size: 28rpx;
						height: 39rpx;
						line-height: 39rpx;
					}
				}
			}
		}
	}
</style>